package com.common.demo.controller;

/**
 * @Author: hua
 * @Date: 2023/05/31 15:35
 * @version: v1.0
 * @Description: TODO
 */

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: UserController
 * @Description: TODO
 * @Author: liujianfu
 * @Date: 2021/03/04 23:09:19
 * @Version: V1.0
 **/
@RestController
@RequestMapping("/api")
public class UserController {
    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @GetMapping("log")
    public Object testLog() {

        logger.debug("======this is debug level");
        logger.info("===============this is info level ");
        logger.warn("============this is warn level ");
        int k = 5 / 0;
        logger.error("this is error level");
        return "ok";
    }
}
